Scikit Learn Machine Learning Tutorial for investing with Python p. 5 List index out of range

by: t0mgs, 7 years ago

Last edited: 7 years ago

https://www.youtube.com/watch?v=2vQfMAEu670

Thanks for the tutorial series, first of all.

On to business - as many comments on the video page mention, there's a "List index out of range error" that keeps popping up.

I'm on Ubuntu 16.04, running the script via an Anaconda virtualenv with Python 2, if that matters in any regard.

All in all, I've seen it in 2 places:

1. Right after the (there should be double backward slashes that get cut here due to formatting):

ticker = each_dir.split('')[1]


And, after Changing the double backslashes into one forward slash (because I'm not on Windows, as you mentioned in one of your comments) then I get this error:

2. At the end, near

value = source.split(gather+':</td><td class="yfnc_tabledata1">')[1].split('</td>')[0]


Thoughts?

And again, thanks for the tutorials!

-T




You must be logged in to post. Please login or register an account.



I don't think python version should impact this. I am not sure what part you are on here. For example, on part 6, we are encasing that #2 in a try/except: https://pythonprogramming.net/using-pandas-structure-process-data/

We're doing that because there might not be data there, IIRC.

-Harrison 7 years ago

You must be logged in to post. Please login or register an account.


You fixed it on pt. 6 - should have just carried on:). Thanks!

-t0mgs 7 years ago

You must be logged in to post. Please login or register an account.